/*
 * @Author: your name
 * @Date: 2021-09-19 18:44:31
 * @LastEditTime: 2021-09-22 21:04:55
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup-ej-app\src\main.js
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/vant.js'
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
// 时间戳过滤器
Vue.filter('dateFormat', (dataStr) => {
  var time = new Date(dataStr)

  function timeAdd0(str) {
    if (str < 10) {
      str = '0' + str
    }
    return str
  }
  var y = time.getFullYear()
  var m = time.getMonth() + 1
  var d = time.getDate()
  var h = time.getHours()
  var mm = time.getMinutes()
  var s = time.getSeconds()
  return y + '-' + timeAdd0(m) + '-' + timeAdd0(d) + ' ' + timeAdd0(h) + ':' + timeAdd0(mm) + ':' + timeAdd0(s)
})
Vue.filter('strFormat',(str)=>{
  // let length = 3
  str = String(str).split('.')
  str[0] = str[0].replace(new RegExp('(\\d)(?=(\\d{' + 3 + '})+$)', 'ig'), '$1,')
  return str.join('.')
  // function getFData1000 (source, length = 3) {
  //   source = String(source).split('.')
  //   source[0] = source[0].replace(new RegExp('(\\d)(?=(\\d{' + length + '})+$)', 'ig'), '$1,')
  //   return source.join('.')
  // }
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
